#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
#define MAX_N 9000
int a[MAX_N];
int n;
struct lnode{
    int val,cnt;
    int lch,rch;
    int self;

    char *toString(){
        char * buff = (char * ) malloc(1000*sizeof(char));
        sprintf(buff,"val=%d, cnt=%d, lch=%d, rch=%d",val,cnt,lch,rch);
        return buff;
    }
}tree[MAX_N];
int tree_cnt;

int mktree(int l,int r){
    if (r<l) return -1;
    int m = (l+r) >> 1;
    int lch = mktree(l,m-1);
    int rch = mktree(m+1,r);

    tree_cnt ++;
    tree[tree_cnt].lch = lch;
    tree[tree_cnt].rch = rch;
    tree[tree_cnt].val = m;
    return tree_cnt;
}

void Insert(int p , int root){
    //cout << p <<endl;
    if (p > tree[root].val) Insert(p , tree[root].rch);
    else if (p<tree[root].val){
        tree[root].cnt++;
        Insert(p,tree[root].lch);
    }else {
        tree[root].self++;
    }
}

int query(int k , int root){
    if (k <= tree[root].cnt){
        tree[root].cnt--;
        return query(k , tree[root].lch);
    }
    k = k - tree[root].cnt - tree[root].self;
    if (k==0) {
        tree[root].self--;
        return tree[root].val;
    }
    return query(k,tree[root].rch);
}

void print_tree(){
    for (int i = 1 ; i <= tree_cnt ; i++){
        printf("#%d: %s\n",i,tree[i].toString());
    }
}
int main(){
    //freopen("2182.txt","r",stdin);
    scanf("%d",&n);

    memset(tree , 0 , sizeof(tree));
    tree_cnt = 0;
    int root = mktree(1,n);

    for (int i = 1 ; i<= n;i++) Insert(i,root);

    for (int i = 2 ; i<= n ; i++) scanf("%d",&a[i]);
    a[1] = 0;
    for (int i = n ; i>=1; i--){
        a[i] = query(a[i]+1,root);
    }

    for (int i = 1; i<=n ;i++) printf("%d\n",a[i]);

    return 0;
}
